package com.mszlu.blog.controller;

import com.mszlu.blog.service.SysUserService;
import com.mszlu.blog.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author linKe
 */
@Api(value="用户管理",tags = "usersApi")
@RestController
@RequestMapping("users")
public class UsersController {

    @Resource
    private SysUserService sysUserService;


    @ApiOperation(value = "@RequestHeader 获取头部信息")
    @ApiImplicitParam(name = "token",value = "用户认证信息")
    @GetMapping("currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){
        return sysUserService.findUserByToken(token);
    }
}
